package cn.edu.scau.controller;

import cn.edu.scau.common.utils.ApiResponse;
import cn.edu.scau.service.EmployeeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.repository.query.Param;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @description: 分析控制器
 * @author: yuxiang
 * @create: 2021-03-29 20:45
 **/
@RestController
@RequestMapping("/analysis")
public class AnalysisController {

    @Autowired
    private EmployeeService employeeService;

    /**
     * 首页-总量分析
     * @return
     */
    @GetMapping("/home/count")
    private ApiResponse getAmountCount(){
        return employeeService.getAmountCount();
    }


    /**
     * 首页-人才流出情况
     * @param time
     * @return
     */
    @GetMapping("/home/flow")
    private ApiResponse getTalentFlow(@RequestParam(name = "time")String time){
        return employeeService.getTalentFlow(time);
    }

    /**
     * 首页-人才流出情况
     * @param time
     * @return
     */
    @GetMapping("/home/deptNumber")
    private ApiResponse getDeptNumber(@RequestParam(name = "time")String time){
        return employeeService.getDeptNumber(time);
    }

    /**
     * 分析-资本月报-人力资源
     * @return
     */
    @GetMapping("/monthlyReport/hrSource")
    private ApiResponse getHRData(){
        return employeeService.getHRData();
    }

    /**
     * 分析-资本月报-绩效月报
     * @return
     */
    @GetMapping("/monthlyReport/perfScore")
    private ApiResponse getPerfScore(){
        return employeeService.getPerfScore();
    }

    /**
     * 分析-招聘分析-人数分析
     * @return
     */
    @GetMapping("/recruit/number")
    private ApiResponse getRecruitNumber(){
        return employeeService.getRecruitNumber();
    }

    /**
     * 分析-招聘分析-部门性别对比
     * @return
     */
    @GetMapping("/recruit/sex")
    private ApiResponse getRecruitSex(){
        return employeeService.getRecruitSex();
    }

    /**
     * 分析-招聘分析-招聘渠道
     * @return
     */
    @GetMapping("/recruit/source")
    private ApiResponse getRecruitSource(){
        return employeeService.getRecruitSource();
    }


    /**
     * 分析-人力分析-员工学历数量
     * @return
     */
    @GetMapping("/hr/education")
    private ApiResponse getHrEducation(){
        return employeeService.getHrEducation();
    }

    /**
     * 分析-人力分析-工资进度
     * @return
     */
    @GetMapping("/hr/salary")
    private ApiResponse getHrsalary(){
        return employeeService.getHrSalary();
    }

    /**
     * 分析-人力分析-工资部门分配
     * @return
     */
    @GetMapping("/hr/deptSalary")
    private ApiResponse getHrDeptSalary(){
        return employeeService.getHrDeptSalary();
    }

    /**
     * 分析-人才分析-各部门教育分布
     * @return
     */
    @GetMapping("/talent/education")
    private ApiResponse getTalentDeptEdu(){
        return employeeService.getTalentDeptEdu();
    }

    /**
     * 分析-人才分析-各学历平均工资分布
     * @return
     */
    @GetMapping("/talent/eduAvgSalary")
    private ApiResponse getEduAvgSalary(){
        return employeeService.getEduAvgSalary();
    }
}
